﻿using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using YNTK.System.Entitys.Dto.Common;

namespace YNTK.System.Interfaces.Common
{
    /// <summary>
    /// 通用控制器
    /// </summary>
    public interface IFileService
    {
        /// <summary>
        /// 文件上传
        /// </summary>
        /// <param name="type"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        Task<dynamic> Uploader(string type, IFormFile file);

        /// <summary>
        /// 根据类型获取文件存储路径
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        string GetPathByType(string type);

        /// <summary>
        /// 导出
        /// </summary>
        /// <param name="jsonStr"></param>
        /// <returns></returns>
        dynamic Export(string jsonStr,string name);

        /// <summary>
        /// 导入
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        string Import(IFormFile file);

        /// <summary>
        /// 文件上传
        /// </summary>
        /// <param name="type"></param>
        /// <param name="file"></param>
        void UploadFile(string type, IFormFile file);

        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="storagePath">文件存储路径,存储目录/存储文件名</param>
        /// <returns></returns>
        void DeleteSingleFile(string storagePath);

        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="paths">文件存储路径集合</param>
        void DeleteFileByPaths(List<string> paths);

        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="files">文件集合</param>
        /// <returns></returns>
        void DeleteFiles(List<FileListDto> files);

        /// <summary>
        /// 手写签名Base64转换图片
        /// </summary>
        /// <param name="strbase64"></param>
        /// <returns></returns>
        Task<ReturnUploadFileDto> Base64StringToImage(string strbase64);

        /// <summary>
        /// 获取图片base64
        /// </summary>
        /// <param name="storagePath">文件存储路径,存储目录/存储文件名</param>
        /// <returns></returns>
        string GetImageBase64(string storagePath);
    }
}
